package com.idopartx.phonelightning.widget

import android.app.Dialog
import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.graphics.drawable.ColorDrawable
import android.widget.TextView
import com.idopartx.phonelightning.R

open class LoadingDialog(context: Context, msg:String) : Dialog(context) {

    var callback: DialogCallBack? = null
    var msg = "";

    init {
        this.callback = callback
        this.msg = msg
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val window = window
        window!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
        setContentView(R.layout.dialog_loading)
        setCanceledOnTouchOutside(false)

        var msgTxt = findViewById<TextView>(R.id.msgText)
        msgTxt.text = msg
    }

    interface DialogCallBack {
        fun onOk()
    }

}